/*
 * Copyright 2003-2005 (c) Live Media Pty Ltd. <argot@einet.com.au> 
 *
 * This software is licensed under the Argot Public License 
 * which may be found in the file LICENSE distributed 
 * with this software.
 *
 * More information about this license can be found at
 * http://www.einet.com.au/License
 * 
 * The Developer of this software is Live Media Pty Ltd,
 * PO Box 4591, Melbourne 3001, Australia.  The license is subject 
 * to the law of Victoria, Australia, and subject to exclusive 
 * jurisdiction of the Victorian courts.
 */

#include "Types.h"

#include "TypeReaderAuto.h"

#include "meta/MetaExpression.h"
#include "meta/MetaAbstract.h"
#include "meta/MetaArray.h"
#include "meta/MetaBasic.h"
#include "meta/MetaMap.h"
#include "meta/MetaName.h"
#include "meta/MetaReference.h"
#include "meta/MetaSequence.h"

int type_reader_auto( type_input_stream * in, type_element * element, typeConstructor constructor, void * data )
{
	meta_sequence * sequence = (meta_sequence *) element;
	void * obj;

	sequence->expression.doRead( in, element, NULL );
	obj = constructor( &(in->stack.top->data.list), in->map, data );
	if ( obj == NULL ) return TYPE_EOF;
	
	type_stack_set_ptr( type_input_stack( in ), element, obj );
	return TYPE_OK;
}


